1
|
|
|
import { select } from 'd3-selection'; |
2
|
|
|
import { LabelColors, Selectors } from '../AppConsts'; |
3
|
|
|
import { DependencyLink, DependencyNode } from '../../components/types'; |
4
|
|
|
|
5
|
|
|
export function selectHighLightedNodes() { |
6
|
|
|
return selectAllNodes().filter(function(this: SVGGElement) { |
7
|
|
|
return this.firstElementChild ? this.firstElementChild.getAttribute('fill') !== LabelColors.DEFAULT : false; |
8
|
|
|
}); |
9
|
|
|
} |
10
|
|
|
|
11
|
|
|
export function selectAllNodes() { |
12
|
|
|
return select(Selectors.LABELS).selectAll<SVGGElement, DependencyNode>('g'); |
13
|
|
|
} |
14
|
|
|
|
15
|
|
|
export function selectAllLinks() { |
16
|
|
|
return select(Selectors.LINKS).selectAll<SVGPathElement, DependencyLink>('path'); |
17
|
|
|
} |
18
|
|
|
|
19
|
|
|
export function selectHighlightBackground() { |
20
|
|
|
return select(Selectors.HIGHLIGHT_BACKGROUND); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
export function selectDetailsButtonWrapper() { |
24
|
|
|
return select(Selectors.DETAILS_BUTTON); |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
export function selectDetailsExitButtonWrapper() { |
28
|
|
|
return select(Selectors.DETAILS_EXIT_BUTTON); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
export function selectDetailsButtonRect() { |
32
|
|
|
return selectDetailsButtonWrapper().select('rect'); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
export function selectDetailsButtonText() { |
36
|
|
|
return selectDetailsButtonWrapper().select('text'); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
export function selectDetailsViewContainer() { |
40
|
|
|
return select(Selectors.DETAILS_VIEW_CONTAINER); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
export function selectDetailsContainerDiv() { |
44
|
|
|
return select(Selectors.DETAILS_CONTAINER_DIV); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
export function selectDetailsZoom() { |
48
|
|
|
return select(Selectors.ZOOM_DETAILS); |
49
|
|
|
} |
50
|
|
|
|